package org.netEase.controller;
import java.io.IOException;
import java.util.List;

import javafx.scene.control.Alert;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.Session;

import org.netEase.dao.*;
import org.netEase.dao.impl.*;
import org.netEase.entity.*;
@WebServlet(urlPatterns= {"/backstageManager/login.shtml"})
public class userser extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String name =req.getParameter("name");
		String password =req.getParameter("password");
	
		
		zhanghuDao zhd =new zhanghuimpl();
		zhanghu zu =zhd.getID(name, password );
		if(zu==null){
			resp.sendRedirect(req.getContextPath()+"/backstageManager/login.jsp");
			
		}else{

			req.setAttribute("list", zu);
			resp.sendRedirect(req.getContextPath()+"/backstageManager/indexH.jsp");
		}
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doGet(req, resp);
	}
	

}
